import wei.yigulu.modbus.domain.datatype.ModbusDataTypeEnum;

import java.math.BigDecimal;

public class PointDataConstantValue extends BasePointData {


    public PointDataConstantValue(Integer point, ModbusDataTypeEnum dataType, String value) {
        super(point, dataType, value);


    }

    @Override
    public void joinRealTimeData() {
        if (ModbusDataTypeEnum.A16 != getDataType()) {
            protocolDataContainer.putNumber(getPoint(), new BigDecimal(getValue()));
        } else {
            protocolDataContainer.putBoolean(getPoint(), Boolean.valueOf(getValue()));
        }
    }
}
